<%@page contentType="text/html; charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>书籍列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/back/css/font.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/back/css/xadmin.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/back/js/jquery-3.5.1.js"></script>
    <script src="${pageContext.request.contextPath}/static/back/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/back/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">书籍</a>
        <a>
          <cite>列表</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form id="searchForm" class="layui-form layui-col-md12 x-so" method="post"
          action="">
          <input type="text" id="adminName" name="adminName"  placeholder="请输入书籍名" autocomplete="off" class="layui-input" value="${searchDTO.adminName == null?"":searchDTO.adminName}">
          <button lay-verify="search" class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div>
      <xblock>
        <button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>
        <button class="layui-btn" onclick="x_admin_show('添加书籍','${pageContext.request.contextPath}/back/addview')"><i class="layui-icon"></i>添加</button>
        <span class="x-right" style="line-height:40px">共有数据：${pageInfo.total}条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <th>
              <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
            </th>
            <th>ID</th>
            <th>书籍ID</th>
            <th>书籍名称</th>
            <th>封面</th>
            <th>书籍数量</th>
            <th>小计</th>
            <th>订单时间</th>
            <th>操作</th>

        </thead>
        <tbody>
          <c:forEach items="${pageInfo.list}" var="orderLevel2">
            <tr>
              <td>
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='${orderLevel2.id}'><i class="layui-icon">&#xe605;</i></div>
              </td>
              <td>${orderLevel2.id}</td>
              <td>${orderLevel2.bookId}</td>
              <td>${orderLevel2.bookName}</td>
              <td>
                <c:if test="${!empty orderLevel2.img}">
                  <img src="${orderLevel2.img}" style="width:auto;height:auto;max-width:100%;max-height: 35px"/>
                </c:if>
              </td>
              <td>${orderLevel2.numb}</td>
              <td>${orderLevel2.total}</td>
              <td><fmt:formatDate value="${orderLevel2.orderTime}" pattern="yyyy-MM-dd"/></td>
              <td class="td-manage">
                <a title="查看详情"  onclick="x_admin_show('编辑','${pageContext.request.contextPath}/back/orderlist2view?id=${orderLevel2.id}')" href="javascript:;">
                  <i class="layui-icon">&#xe642;</i>
                </a>
              </td>
            </tr>
          </c:forEach>
        </tbody>
      </table>
      <div class="page">
        <div>
          <c:if test="${pageInfo.hasPreviousPage}">
            <a class="prev" href="${pageContext.request.contextPath}/back/orderlist2view?id=${id}&start=${pageInfo.prePage}">&lt;&lt;</a>
          </c:if>
          <c:forEach items="${pageInfo.navigatepageNums}" var="numb">
            <c:if test="${pageInfo.pageNum == numb}">
              <span class="current">${numb}</span>
            </c:if>
            <c:if test="${pageInfo.pageNum != numb}">
              <a class="num" href="${pageContext.request.contextPath}/back/orderlist2view?id=${id}&start=${numb}">${numb}</a>
            </c:if>
          </c:forEach>
          <c:if test="${pageInfo.hasNextPage}">
            <a class="next" href="${pageContext.request.contextPath}/back/orderlist2view?id=${id}&start=${pageInfo.nextPage}">&gt;&gt;</a>
          </c:if>
        </div>
      </div>

    </div>
    <script>
      layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
          elem: '#',//指定元素
          format:'yyyy-MM-dd'
        });
      });



    </script>

  </body>

</html>